home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / ccd0605.iso / Software / Freeware / Programare / highlight / highlight-W32GUI-2.2-10b-Setup.exe / {app} / src / rtfgenerator.h < prev    next >
C/C++ Source or Header  |  2004-10-21  |  2KB  |  83 lines

  1. /***************************************************************************
  2.                           rtfcode.h  -  description
  3.                              -------------------
  4.     begin                : Die Jul 9 2002
  5.     copyright            : (C) 2002 by Andre Simon
  6.     email                : andre.simon1@gmx.de
  7.  ***************************************************************************/
  8.  
  9. /***************************************************************************
  10.  *                                                                         *
  11.  *   This program is free software; you can redistribute it and/or modify  *
  12.  *   it under the terms of the GNU General Public License as published by  *
  13.  *   the Free Software Foundation; either version 2 of the License, or     *
  14.  *   (at your option) any later version.                                   *
  15.  *                                                                         *
  16.  ***************************************************************************/
  17.  
  18. #ifndef RTFGENERATOR_H
  19. #define RTFGENERATOR_H
  20.  
  21. #include <iostream>
  22. #include <fstream>
  23. #include <string>
  24. #include <sstream>
  25.  
  26. #include "codegenerator.h"
  27. #include "charcodes.h"
  28. #include "version.h"
  29.  
  30. namespace highlight {
  31.  
  32. /**
  33.    \brief This class generates RTF.
  34.  
  35.    It contains information about the resulting document structure (document
  36.    header and footer), the colour system, white space handling and text
  37.    formatting attributes.
  38.  
  39. * @author Andre Simon
  40. */
  41.  
  42. class RtfGenerator : public highlight::CodeGenerator
  43.   {
  44.   public:
  45.  
  46.    /** Constructor
  47.      \param colourTheme Name of Colour theme to use
  48.     */
  49.     RtfGenerator( const string &colourTheme);
  50.     RtfGenerator();
  51.     ~RtfGenerator();
  52.  
  53.    /** prints document header
  54.        \param  title Title of the document
  55.     */
  56.     string getHeader(const string & title);
  57.  
  58.     /** Prints document footer*/
  59.     string getFooter();
  60.  
  61.     /** Prints document body*/
  62.     void printBody();
  63.  
  64.   private:
  65.  
  66.     /** \return escaped character*/
  67.     virtual string maskCharacter(unsigned char );
  68.  
  69.     /**\return text formatting attributes in RTF format */
  70.     string  formatStyleAttributes( const ElementStyle & col);
  71.  
  72.     /** gibt RTF-"Tags" zurueck (Farbindex+bold+kursiv)*/
  73.     string getOpenTag(int styleNumber,const ElementStyle &);
  74.  
  75.     string getCloseTag(const ElementStyle &);
  76.  
  77.     string getMatchingOpenTag(unsigned int styleID);
  78.     string getMatchingCloseTag(unsigned int styleID);
  79.   };
  80.  
  81. }
  82. #endif
  83.